﻿function isEmail(value) {
    var reg = /^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;
    return reg.test(value);
}

function showMessage(control, type, message) {
    removeMessage(control);

    $("#" + control + "-control-group").addClass(type);
    $("#" + control + "-help-block").html(message);
}

function removeMessage(control) {
    $("#" + control + "-control-group").removeClass("success");
    $("#" + control + "-control-group").removeClass("error");
    $("#" + control + "-control-group").removeClass("warning");

    $("#" + control + "-help-block").html('');
}